﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PacketRush.Core
{
    /// <summary>
    /// Describes settings for <see cref="PacketRush.Core.ReliableUdpNetworkingProvider"/>.
    /// </summary>
    public class ReliableUdpSettings
    {
        private int _MaxPacketResends = 10;

        /// <summary>
        /// The maximum number of packet resends, defaults to 10.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Reliable messages require acknowledgement packets, if one endpoint does
        /// not get an acknowledgement packet within a specified amount of time,
        /// the packet will be resent until an acknowledgment is received.
        /// </para>
        /// <para>
        /// <c>MaxPacketResends</c> specifies how many times a packet can be resent
        /// before the provider gives up and assumes the connection is no
        /// longer connected.
        /// </para>
        /// </remarks>
        public int MaxPacketResends
        {
            get { return _MaxPacketResends; }
            set { _MaxPacketResends = value; }
        }

        private int _PacketResendRate = 50;

        /// <summary>
        /// The rate in milliseconds a packet is resent if it has not yet received an ack, defaults to 50ms.
        /// </summary>
        /// <remarks>
        /// <para>
        /// Reliable messages require acknowledgement packets, if one endpoint does
        /// not get an acknowledgement packet within a specified amount of time,
        /// the packet will be resent until an acknowledgment is received.
        /// </para>
        /// <para>
        /// <c>PacketResendRate</c> specifies when a packet should be resent following the 
        /// last time the packet was sent.
        /// </para>
        /// </remarks>
        public int PacketResendRate
        {
            get { return _PacketResendRate; }
            set { _PacketResendRate = value; }
        }


    }
}
